﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DBTMDT.Dal;

namespace DBTMDT.Biz
{
    class BizLichSuMuaBid
    {
        public int IDLichSuMuaBid { get; set; }
        public string MaLichSuMuaBid { get; set; }
        public BizUser IdUser { get; set; }
        public BizGoiBid IdGoiBid { get; set; }
        public string PhuongThucThanhToan { get; set; }

        public BizLichSuMuaBid()
        {
            this.IDLichSuMuaBid = -1;
            this.IdUser = new BizUser();
            this.IdGoiBid = new BizGoiBid();
        }

        public BizLichSuMuaBid(int IDLichSuMuaBid, string MaLichSuMuaBid, BizUser IdUser, BizGoiBid IdGoiBid)
        {
            this.IDLichSuMuaBid = IDLichSuMuaBid;
            this.MaLichSuMuaBid = MaLichSuMuaBid;
            this.IdUser = IdUser;
            this.IdGoiBid = IdGoiBid;        
        }

        public BizLichSuMuaBid(string MaLichSuMuaBid, BizUser IdUser, BizGoiBid IdGoiBid)
        {
            this.IDLichSuMuaBid = IDLichSuMuaBid;
            this.MaLichSuMuaBid = MaLichSuMuaBid;
            this.IdUser = IdUser;
            this.IdGoiBid = IdGoiBid;
        }


        public void Save()
        {
            if (this.IDLichSuMuaBid == -1)
                this.IDLichSuMuaBid = DalLichSuMuaBid.Insert(this);
            else
                DalLichSuMuaBid.Update(this);
        
        }

    }
}
